#ifndef PARTICLE_H
#define PARTICLE_H

#include <chrono>

#include <raylib.h>

enum class ParticleState {
	Flying,
	Done
};

class Particle {
	public:
		Particle(Vector3 pos, Vector3 speed, float dragCoefficient, Color color)
			: m_pos{pos},
			  m_speed{speed},
			  m_dragCoefficient{dragCoefficient},
			  m_color{color} {};

		virtual ~Particle() {};

		virtual void update(const std::chrono::nanoseconds& delt);

		virtual void draw();

		Vector3 pos() {
			return m_pos;
		};

		void setPos(Vector3 pos) {
			m_pos = pos;
		}

		Color color() {
			return m_color;
		};

		void setDragCoefficient(float value) {
			m_dragCoefficient = value;
		}

		float dragCoefficeint() {
			return m_dragCoefficient;
		}

		Vector3 speed() {
			return m_speed;
		}

		void setSpeed(Vector3 speed) {
			m_speed = speed;
		}

		void setRadiusChangeRatePara(float mu, float theta, float A) {
			m_mu = mu;
			m_theta = theta;
			m_A = A;
		}

		bool isDone() {
			return m_state == ParticleState::Done;
		}

		void setMovePara(float mu, float theta, float A) {
			m_mu = mu;
			m_theta = theta;
			m_A = A;
		}

	protected:
		Vector3 m_pos;
		float m_radius{1};
		Vector3 m_speed;
	private:
		float m_dragCoefficient;
	protected:
		Color m_color;
		ParticleState m_state {ParticleState::Flying};

	private:
		float m_theta;
		float m_mu;
		float m_A;
		std::chrono::nanoseconds m_duration {1};

};

#endif
